<template>
  <div id="app">
    <!-- 头部开始 -->
      <!-- 顶部导航栏开始 -->
         <van-nav-bar
              title="京东东"
              left-text="返回"
              right-text="登录"
              left-arrow
              @click-left="onClickLeft"
              @click-right="onClickRight"
              fixed
      />
        <!-- 顶部导航栏结束 --> 
    <!-- 头部结束 -->
    <div id="nav">
    </div>
    <router-view/>
    <!-- 尾部开始 -->
      <van-tabbar v-model="active">
        <!-- Home路由 -->
        <van-tabbar-item icon="wap-home"><router-link to="/">首页</router-link></van-tabbar-item>
        <!-- Discover路由 -->
        <van-tabbar-item icon="browsing-history"> <router-link to="/Discover">发现</router-link></van-tabbar-item>
        <!--Seek路由-->
        <van-tabbar-item icon="search" to="/seek">搜索</van-tabbar-item>
        <!--PersonalCenter路由-->
         <van-tabbar-item to="/PersonalCenter">
          <span>个人中心</span>
          <img
            slot="icon"
            slot-scope="props"
            :src="props.active ? icon.active : icon.inactive"
          >
        </van-tabbar-item>
      </van-tabbar>
    <!-- 尾部结束 -->
  </div>
</template>

<style lang="scss">
* {
  padding: 0px;
  margin: 0px;
}
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>

<script>
export default {
   methods: {
      // 页头
      onClickLeft() { 
          this.$router.push({ path: './' });//返回上一层
      },
      onClickRight() {
          this.$router.push({ path: '/Login' })    
      }
    },
  data() {
    return {
      
      active: 0,
      icon: {
        active: 'https://img.yzcdn.cn/vant/user-active.png',
        inactive: 'https://img.yzcdn.cn/vant/user-inactive.png'
      }
    }
  }
}


</script>
